import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/loginOrRegister/Login'
import Register from '@/components/loginOrRegister/Register'
import Home from '@/components/home/Home'
import UserList from '@/components/user/List'
import GroupUserList from '@/components/user/GroupUserList'
import CustomerList from '@/components/customer/List'
import AddCustomerList from '@/components/customer/addcustomerlist/AddCustomerList'
import VisitList from '@/components/visit/List'
import Index from '@/components/home/Index'

Vue.use(Router)

export default new Router({
    routes: [
        {path: '/', name: 'index', redirect: '/login'},
        {path: '/login', name: 'Login', component: Login},
        {path: '/register', name: 'Register', component: Register},
        {
            path: '/home', name: 'Home', component: Home,
            children: [
                {path: 'index', name: 'Index', component: Index},
                {path: 'customer/list', name: 'CustomerList', component: CustomerList},
                {path: 'customer/addcustomerlist', name: 'AddCustomerList', component: AddCustomerList},
                {path: 'user/list', name: 'UserList', component: UserList},
                {path: 'usergroup/list', name: 'GroupUserList', component: GroupUserList},
                {path: 'visit/list', name: 'VisitList', component: VisitList},
            ],
        },
    ]
})
